<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Zend_Service_LiveDocx - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.service.livedocx.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.service.livedocx.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.flickr.html">Zend_Service_Flickr</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.service.livedocx" class="section"><div class="info"><h1 class="title">Zend_Service_LiveDocx</h1></div>
    

    <div class="section" id="zend.service.livedocx.introduction"><div class="info"><h1 class="title">Introduction to LiveDocx</h1></div>
        

        <p class="para">
            LiveDocx is a <acronym class="acronym">SOAP</acronym> service that allows developers to generate word
            processing documents by combining structured data from <acronym class="acronym">PHP</acronym> with a
            template, created in a word processor. The resulting document can be saved as a
            <acronym class="acronym">PDF</acronym>, <acronym class="acronym">DOCX</acronym>, <acronym class="acronym">DOC</acronym>,
            <acronym class="acronym">HTML</acronym> or <acronym class="acronym">RTF</acronym> file. LiveDocx implements <a href="http://en.wikipedia.org/wiki/Mail_merge" class="link external">&raquo; mail-merge</a> in
            <acronym class="acronym">PHP</acronym>.
        </p>

        <p class="para">
            The family of <span class="classname">Zend_Service_LiveDocx</span> components provides a clean
            and simple interface to the <a href="http://www.livedocx.com" class="link external">&raquo; LiveDocx API</a>
            and additionally offers functionality to improve network performance.
        </p>

        <p class="para">
            In addition to this section of the manual, if you are interested in learning more about
            <span class="classname">Zend_Service_LiveDocx</span> and the backend <acronym class="acronym">SOAP</acronym>
            service LiveDocx, please take a look at the following resources:
        </p>

        <ul class="itemizedlist">
            <li class="listitem">
                <p class="para">
                    <em class="emphasis">Shipped demonstration applications</em>. There are a large
                    number of demonstration applications in the directory
                    <em class="emphasis">/demos/Zend/Service/LiveDocx</em> of the Zend Framework
                    distribution file or trunk version, checked out of the standard SVN repository.
                    These are designed to get you up to speed with
                    <span class="classname">Zend_Service_LiveDocx</span> within a matter of minutes.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <a href="http://www.phplivedocx.org/" class="link external">&raquo; 
                    <span class="classname">Zend_Service_LiveDocx</span> blog and web site</a>.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <a href="http://www.livedocx.com/pub/documentation/api.aspx" class="link external">&raquo; 
                    LiveDocx SOAP API documentation</a>.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <a href="https://api.livedocx.com/1.2/mailmerge.asmx?wsdl" class="link external">&raquo; 
                    LiveDocx WSDL</a>.
                </p>
            </li>

            <li class="listitem">
                <p class="para">
                    <a href="https://www.livedocx.com/" class="link external">&raquo; LiveDocx blog and web site</a>.
                </p>
            </li>
        </ul>

        <div class="section" id="zend.service.livedocx.account"><div class="info"><h1 class="title">Sign Up for an Account</h1></div>
            

            <p class="para">
                Before you can start using LiveDocx, you must first <a href="https://www.livedocx.com/user/account_registration.aspx" class="link external">&raquo; sign up</a>
                for an account. The account is completely free of charge and you only need to
                specify a <em class="emphasis">username</em>, <em class="emphasis">password</em> and
                <em class="emphasis">e-mail address</em>. Your login credentials will be dispatched to
                the e-mail address you supply, so please type carefully.
            </p>
        </div>

        <div class="section" id="zend.service.livedocx.templates-documents"><div class="info"><h1 class="title">Templates and Documents</h1></div>
            

            <p class="para">
                LiveDocx differentiates between the following terms: 1)
                <em class="emphasis">template</em> and 2) <em class="emphasis">document</em>. In order to
                fully understand the documentation and indeed the actual <acronym class="acronym">API</acronym>, it
                is important that any programmer deploying LiveDocx understands the difference.
            </p>

            <p class="para">
                The term <em class="emphasis">template</em> is used to refer to the input file, created
                in a word processor, containing formatting and text fields. You can download an
                <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/license-agreement-template.docx" class="link external">&raquo; example
                    template</a>, stored as a <acronym class="acronym">DOCX</acronym> file. The term
                <em class="emphasis">document</em> is used to refer to the output file that contains the
                template file, populated with data - i.e. the finished document. You can download an
                <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/license-agreement-document.pdf" class="link external">&raquo; example
                    document</a>, stored as a <acronym class="acronym">PDF</acronym> file.
            </p>
        </div>

        <div class="section" id="zend.service.livedocx.formats"><div class="info"><h1 class="title">Supported File Formats</h1></div>
            

            <p class="para">
                LiveDocx supports the following file formats:
            </p>

            <div class="section" id="zend.service.livedocx.formats.template"><div class="info"><h1 class="title">Template File Formats (input)</h1></div>
                

                <p class="para">
                    Templates can be saved in any of the following file formats:
                </p>

                <ul class="itemizedlist">
                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Office_Open_XML" class="link external">&raquo; DOCX</a> -
                            Office Open <acronym class="acronym">XML</acronym> format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/DOC_(computing)" class="link external">&raquo; DOC</a> -
                            Microsoft Word <acronym class="acronym">DOC</acronym> format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Rich_Text_Format" class="link external">&raquo; RTF</a> -
                            Rich text file format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://www.textcontrol.com/" class="link external">&raquo; TXD</a> - TX Text Control
                            format
                        </p>
                    </li>
                </ul>
            </div>

            <div class="section" id="zend.service.livedocx.formats.document"><div class="info"><h1 class="title">Document File Formats (output):</h1></div>
                

                <p class="para">
                    The resulting document can be saved in any of the following file formats:
                </p>

                <ul class="itemizedlist">
                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Office_Open_XML" class="link external">&raquo; DOCX</a> -
                            Office Open <acronym class="acronym">XML</acronym> format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/DOC_(computing)" class="link external">&raquo; DOC</a> -
                            Microsoft Word <acronym class="acronym">DOC</acronym> format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Xhtml" class="link external">&raquo; HTML</a> -
                            <acronym class="acronym">XHTML</acronym> 1.0 transitional format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Rich_Text_Format" class="link external">&raquo; RTF</a> -
                            Rich text file format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Portable_Document_Format" class="link external">&raquo; PDF</a>
                            - Acrobat Portable Document Format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://www.textcontrol.com/" class="link external">&raquo; TXD</a> - TX Text Control
                            format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Text_file" class="link external">&raquo; TXT</a> -
                            <acronym class="acronym">ANSI</acronym> plain text
                        </p>
                    </li>
                </ul>
            </div>

            <div class="section" id="zend.service.livedocx.formats.imageimport"><div class="info"><h1 class="title">Image File Formats (import):</h1></div>
                

                <p class="para">
                    Images can be merged into templates in any of following file formats:
                </p>

                <ul class="itemizedlist">
                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/BMP_file_format" class="link external">&raquo; BMP</a> -
                            Bitmap image format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/GIF" class="link external">&raquo; GIF</a> - Graphics
                            Interchange Format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Jpg" class="link external">&raquo; JPG</a> - Joint
                            Photographic Experts Group format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics" class="link external">&raquo; PNG</a>
                            - Portable Network Graphics format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Tagged_Image_File_Format" class="link external">&raquo; TIFF</a>
                            - Tagged Image File Format
                        </p>
                    </li>

                </ul>
            </div>

            <div class="section" id="zend.service.livedocx.formats.imageexport"><div class="info"><h1 class="title">Image File Formats (output):</h1></div>
                

                <p class="para">
                    The resulting document can be exported to any of the following graphical file
                    formats:
                </p>

                <ul class="itemizedlist">
                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/BMP_file_format" class="link external">&raquo; BMP</a> -
                            Bitmap image format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/GIF" class="link external">&raquo; GIF</a> - Graphics
                            Interchange Format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Jpg" class="link external">&raquo; JPG</a> - Joint
                            Photographic Experts Group format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics" class="link external">&raquo; PNG</a>
                            - Portable Network Graphics format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Tagged_Image_File_Format" class="link external">&raquo; TIFF</a>
                            - Tagged Image File Format
                        </p>
                    </li>

                    <li class="listitem">
                        <p class="para">
                            <a href="http://en.wikipedia.org/wiki/Windows_Metafile" class="link external">&raquo; WMF</a> -
                            Windows Meta File format
                        </p>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="section" id="zend.service.livedocx.mailmerge"><div class="info"><h1 class="title">Zend_Service_LiveDocx_MailMerge</h1></div>
        

        <p class="para">
             <span class="classname">Zend_Service_LiveDocx_MailMerge</span> is the mail-merge object in the
             <span class="classname">Zend_Service_LiveDocx</span> family.
        </p>

        <div class="section" id="zend.service.livedocx.mailmerge.generation"><div class="info"><h1 class="title">Document Generation Process</h1></div>
            

            <p class="para">
                The document generation process can be simplified with the following equation:
            </p>

            <p class="para">
                <em class="emphasis">Template + Data = Document</em>
            </p>

            <p class="para">
                Or expressed by the following diagram:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.generation-diabasic_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.generation-diabasic_zoom.png" alt="zend.service.livedocx.mailmerge.generation-diabasic_zoom.png" width="450" height="244" /></a></div></div>
            </p>

            <p class="para">
                Data is inserted into template to create a document.
            </p>

            <p class="para">
                A template, created in a word processing application, such as Microsoft Word, is
                loaded into LiveDocx. Data is then inserted into the template and the resulting
                document is saved to any supported format.
            </p>
        </div>

        <div class="section" id="zend.service.livedocx.mailmerge.templates"><div class="info"><h1 class="title">Creating Templates in Microsoft Word 2007</h1></div>
            

            <p class="para">
                Start off by launching Microsoft Word and creating a new document. Next, open up the
                <em class="emphasis">Field</em> dialog box. This looks as follows:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-msworddialog_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-msworddialog_zoom.png" alt="zend.service.livedocx.mailmerge.templates-msworddialog_zoom.png" width="450" height="296" /></a></div></div>
            </p>

            <p class="para">
                Microsoft Word 2007 Field dialog box.
            </p>

            <p class="para">
                Using this dialog, you can insert the required merge fields into your document.
                Below is a screenshot of a license agreement in Microsoft Word 2007. The merge
                fields are marked as <strong class="command">{ MERGEFIELD FieldName }</strong>:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-mswordtemplatefull_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-mswordtemplatefull_zoom.png" alt="zend.service.livedocx.mailmerge.templates-mswordtemplatefull_zoom.png" width="450" height="338" /></a></div></div>
            </p>

            <p class="para">
                Template in Microsoft Word 2007.
            </p>

            <p class="para">
                Now, save the template as <em class="emphasis">template.docx</em>.
            </p>

            <p class="para">
                 In the next step, we are going to populate the merge fields with textual data from
                 <acronym class="acronym">PHP</acronym>.
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-mswordtemplatecropped_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-mswordtemplatecropped_zoom.png" alt="zend.service.livedocx.mailmerge.templates-mswordtemplatecropped_zoom.png" width="450" height="89" /></a></div></div>
            </p>

            <p class="para">
                Cropped template in Microsoft Word 2007.
            </p>

            <p class="para">
                To populate the merge fields in the above cropped screenshot of the <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/license-agreement-template.docx" class="link external">&raquo; template</a>
                in Microsoft Word, all we have to code is as follows:
            </p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;setLocalTemplate(&#039;template.docx&#039;);

$phpLiveDocx-&gt;assign(&#039;software&#039;, &#039;Magic Graphical Compression Suite v1.9&#039;)
            -&gt;assign(&#039;licensee&#039;, &#039;Henry Döner-Meyer&#039;)
            -&gt;assign(&#039;company&#039;,  &#039;Co-Operation&#039;);

$phpLiveDocx-&gt;createDocument();

$document = $phpLiveDocx-&gt;retrieveDocument(&#039;pdf&#039;);

file_put_contents(&#039;document.pdf&#039;, $document);
</pre>


            <p class="para">
                The resulting document is written to disk in the file
                <em class="emphasis">document.pdf</em>. This file can now be post-processed, sent via
                e-mail or simply displayed, as is illustrated below in <em class="emphasis">Document Viewer
                    2.26.1</em> on <em class="emphasis">Ubuntu 9.04</em>:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-msworddocument_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-msworddocument_zoom.png" alt="zend.service.livedocx.mailmerge.templates-msworddocument_zoom.png" width="450" height="360" /></a></div></div>
            </p>

            <p class="para">
                Resulting document as <acronym class="acronym">PDF</acronym> in Document Viewer 2.26.1.
            </p>
        </div>


        <div class="section" id="zend.service.livedocx.mailmerge.imagemerge"><div class="info"><h1 class="title">Merging image data</h1></div>

            

            <p class="para">
                Using <span class="classname">Zend_Service_LiveDocx_MailMerge</span> it is also possible to merge images into
                a template. This feature is useful, for example, in the case of a badge application
                for a conference. In addition to the name and company name that should appear on
                the badge, it is possible to insert a photo of the delegate, using the API.
            </p>

            <p class="para">
                Even it is sounds a little counter-intuitive, image-merging also work with
                text fields, as described in the section above. In fact, inserting a text field
                for an image is identical to inserting a text field for textual information.
                The only difference is the naming convention of the text field. Whereas, a text
                field for textual information can have (almost) any identifier, a text field for
                an image must start with <em class="emphasis">image:</em>. For example, in the case of our badge
                application, we would have the following 3 fields:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-imagemerge_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.templates-imagemerge_zoom.png" alt="zend.service.livedocx.mailmerge.templates-imagemerge_zoom.png" width="450" height="179" /></a></div></div>
            </p>

            <p class="para">
                The text field, into which image data will be inserted is called <em class="emphasis">image:photo</em>
                and can be populated just like any other text field, using the assign method. The
                text fields <em class="emphasis">name</em> and <em class="emphasis">company</em> are regular
                text fields for textual information.
            </p>

            <p class="para">
                Before we insert graphic data, we first have to upload the image to the backend
                LiveDocx server. This can be achieved using the <em class="emphasis">uploadImage($filename)</em> method.
            </p>

            <p class="para">The following code snippet illustrates the flow:</p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;username&#039;)
            -&gt;setPassword(&#039;password&#039;);

$photoFilename = &#039;dailemaitre.jpg&#039;;

if (!$phpLiveDocx-&gt;imageExists($photoFilename)) {
    $phpLiveDocx-&gt;uploadImage($photoFilename);
}

$phpLiveDocx-&gt;setLocalTemplate(&#039;template.docx&#039;);

$phpLiveDocx-&gt;assign(&#039;name&#039;,        &#039;Daï Lemaitre&#039;)
            -&gt;assign(&#039;company&#039;,     &#039;Megasoft Co-operation&#039;)
            -&gt;assign(&#039;date&#039;,        Zend_Date::now()-&gt;toString(Zend_Date::DATE_LONG))
            -&gt;assign(&#039;image:photo&#039;, $photoFilename);

$phpLiveDocx-&gt;createDocument();

$document = $phpLiveDocx-&gt;retrieveDocument(&#039;pdf&#039;);

file_put_contents(&#039;document.pdf&#039;, $document);

$phpLiveDocx-&gt;deleteImage($photoFilename);
</pre>


            <p class="para">
                Note that all images uploaded to your LiveDocx account must have a unique
                filename. In the case that you only intend to use the image once (such
                as is probable for our badge application), it makes sense to immediately
                delete it from the backend, using the <em class="emphasis">deleteImage($filename)</em> method.
            </p>

        </div>

        <div class="section" id="zend.service.livedocx.mailmerge.advanced"><div class="info"><h1 class="title">Advanced Mail-Merge</h1></div>
            

            <p class="para">
                <span class="classname">Zend_Service_LiveDocx_MailMerge</span> allows designers to insert
                any number of text fields into a template. These text fields are populated with data
                when <em class="emphasis">createDocument()</em> is called.
            </p>

            <p class="para">
                In addition to text fields, it is also possible specify regions of a document, which
                should be repeated.
            </p>

            <p class="para">
                For example, in a telephone bill it is necessary to print out a list of all
                connections, including the destination number, duration and cost of each call. This
                repeating row functionality can be achieved with so called blocks.
            </p>

            <p class="para">
                <em class="emphasis">Blocks</em> are simply regions of a document, which are repeated
                when  <span class="methodname">createDocument()</span> is called. In a block any number of
                <em class="emphasis">block fields</em> can be specified.
            </p>

            <p class="para">
                Blocks consist of two consecutive document targets with a unique name. The following
                screenshot illustrates these targets and their names in red:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mergefieldblockformat_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mergefieldblockformat_zoom.png" alt="zend.service.livedocx.mailmerge.advanced-mergefieldblockformat_zoom.png" width="450" height="76" /></a></div></div>
            </p>

            <p class="para">
                The format of a block is as follows:
            </p>

            <pre class="programlisting brush: text">
blockStart_ + unique name
blockEnd_ + unique name
</pre>


            <p class="para">For example:</p>

            <pre class="programlisting brush: text">
blockStart_block1
blockEnd_block1
</pre>


            <p class="para">
                The content of a block is repeated, until all data assigned in the block fields has
                been injected into the template. The data for block fields is specified in
                <acronym class="acronym">PHP</acronym> as a multi-assoc array.
            </p>

            <p class="para">
                The following screenshot of a template in Microsoft Word 2007 shows how block fields
                are used:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mswordblockstemplate_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mswordblockstemplate_zoom.png" alt="zend.service.livedocx.mailmerge.advanced-mswordblockstemplate_zoom.png" width="450" height="338" /></a></div></div>
            </p>

            <p class="para">
                Template, illustrating blocks in Microsoft Word 2007.
            </p>

            <p class="para">
                The following code populates the above template with data.
            </p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;setLocalTemplate(&#039;template.doc&#039;);

$billConnections = array(
    array(
        &#039;connection_number&#039;   =&gt; &#039;+49 421 335 912&#039;,
        &#039;connection_duration&#039; =&gt; &#039;00:00:07&#039;,
        &#039;fee&#039;                 =&gt; &#039;€ 0.03&#039;,
    ),
    array(
        &#039;connection_number&#039;   =&gt; &#039;+49 421 335 913&#039;,
        &#039;connection_duration&#039; =&gt; &#039;00:00:07&#039;,
        &#039;fee&#039;                 =&gt; &#039;€ 0.03&#039;,
    ),
    array(
        &#039;connection_number&#039;   =&gt; &#039;+49 421 335 914&#039;,
        &#039;connection_duration&#039; =&gt; &#039;00:00:07&#039;,
        &#039;fee&#039;                 =&gt; &#039;€ 0.03&#039;,
    ),
    array(
        &#039;connection_number&#039;   =&gt; &#039;+49 421 335 916&#039;,
        &#039;connection_duration&#039; =&gt; &#039;00:00:07&#039;,
        &#039;fee&#039;                 =&gt; &#039;€ 0.03&#039;,
    ),
);

$phpLiveDocx-&gt;assign(&#039;connection&#039;, $billConnections);

// ... assign other data here ...

$phpLiveDocx-&gt;createDocument();
$document = $phpLiveDocx-&gt;retrieveDocument(&#039;pdf&#039;);
file_put_contents(&#039;document.pdf&#039;, $document);
</pre>


            <p class="para">
                The data, which is specified in the array <var class="varname">$billConnections</var> is
                repeated in the template in the block connection. The keys of the array
                (<var class="varname">connection_number</var>, <var class="varname">connection_duration</var> and
                <var class="varname">fee</var>) are the block field names - their data is inserted, one row
                per iteration.
            </p>

            <p class="para">
                The resulting document is written to disk in the file
                <em class="emphasis">document.pdf</em>. This file can now be post-processed, sent via
                e-mail or simply displayed, as is illustrated below in <em class="emphasis">Document Viewer
                    2.26.1</em> on <em class="emphasis">Ubuntu 9.04</em>:
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mswordblocksdocument_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.advanced-mswordblocksdocument_zoom.png" alt="zend.service.livedocx.mailmerge.advanced-mswordblocksdocument_zoom.png" width="450" height="360" /></a></div></div>
            </p>

            <p class="para">
                Resulting document as <acronym class="acronym">PDF</acronym> in Document Viewer 2.26.1.
            </p>

            <p class="para">
                You can download the <acronym class="acronym">DOC</acronym> <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/telephone-bill-template.doc" class="link external">&raquo; template
                    file</a> and the resulting <a href="http://www.phplivedocx.org/wp-content/uploads/2009/01/telephone-bill-document.pdf" class="link external">&raquo; PDF
                    document</a>.
            </p>

            <p class="para">
                <em class="emphasis">NOTE:</em> blocks may not be nested.
            </p>
        </div>

        <div class="section" id="zend.service.livedocx.mailmerge.bitmaps"><div class="info"><h1 class="title">Generating bitmaps image files</h1></div>
            

            <p class="para">
                In addition to document file formats,
                <span class="classname">Zend_Service_LiveDocx_MailMerge</span> also allows documents to be
                exported to a number of image file formats (<acronym class="acronym">BMP</acronym>,
                <acronym class="acronym">GIF</acronym>, <acronym class="acronym">JPG</acronym>, <acronym class="acronym">PNG</acronym> and
                <acronym class="acronym">TIFF</acronym>). Each page of the document is saved to one file.
            </p>

            <p class="para">
                The following sample illustrates the use of  <span class="methodname">getBitmaps($fromPage,
                    $toPage, $zoomFactor, $format)</span> and
                 <span class="methodname">getAllBitmaps($zoomFactor, $format)</span>.
            </p>

            <p class="para">
                <var class="varname">$fromPage</var> is the lower-bound page number of the page range that
                should be returned as an image and <var class="varname">$toPage</var> the upper-bound page
                number. <var class="varname">$zoomFactor</var> is the size of the images, as a percent,
                relative to the original page size. The range of this parameter is 10 to 400.
                <var class="varname">$format</var> is the format of the images returned by this method. The
                supported formats can be obtained by calling
                 <span class="methodname">getImageExportFormats()</span>.
            </p>

            <pre class="programlisting brush: php">
$date = new Zend_Date();
$date-&gt;setLocale(&#039;en_US&#039;);

$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;setLocalTemplate(&#039;template.docx&#039;);

$phpLiveDocx-&gt;assign(&#039;software&#039;, &#039;Magic Graphical Compression Suite v1.9&#039;)
            -&gt;assign(&#039;licensee&#039;, &#039;Daï Lemaitre&#039;)
            -&gt;assign(&#039;company&#039;,  &#039;Megasoft Co-operation&#039;)
            -&gt;assign(&#039;date&#039;,     $date-&gt;get(Zend_Date::DATE_LONG))
            -&gt;assign(&#039;time&#039;,     $date-&gt;get(Zend_Date::TIME_LONG))
            -&gt;assign(&#039;city&#039;,     &#039;Lyon&#039;)
            -&gt;assign(&#039;country&#039;,  &#039;France&#039;);

$phpLiveDocx-&gt;createDocument();

// Get all bitmaps
// (zoomFactor, format)
$bitmaps = $phpLiveDocx-&gt;getAllBitmaps(100, &#039;png&#039;);

// Get just bitmaps in specified range
// (fromPage, toPage, zoomFactor, format)
// $bitmaps = $phpLiveDocx-&gt;getBitmaps(2, 2, 100, &#039;png&#039;);

foreach ($bitmaps as $pageNumber =&gt; $bitmapData) {
    $filename = sprintf(&#039;documentPage%d.png&#039;, $pageNumber);
    file_put_contents($filename, $bitmapData);
}
</pre>


            <p class="para">
                This produces two files (<var class="filename">documentPage1.png</var> and
                <var class="filename">documentPage2.png</var>) and writes them to disk in the same
                directory as the executable <acronym class="acronym">PHP</acronym> file.
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.bitmaps-documentpage1_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.bitmaps-documentpage1_zoom.png" alt="zend.service.livedocx.mailmerge.bitmaps-documentpage1_zoom.png" width="450" height="583" /></a></div></div>
            </p>

            <p class="para">
                documentPage1.png.
            </p>

            <p class="para">
                <div class="inlinemediaobject"><div class="imageobject"><a href="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.bitmaps-documentpage2_zoom.png"><img src="images/d481d625821a97b9a5eb2cec99dca50e-zend.service.livedocx.mailmerge.bitmaps-documentpage2_zoom.png" alt="zend.service.livedocx.mailmerge.bitmaps-documentpage2_zoom.png" width="450" height="583" /></a></div></div>
            </p>

            <p class="para">
                documentPage2.png.
            </p>
        </div>

        <div class="section" id="zend.service.livedocx.mailmerge.templates-types"><div class="info"><h1 class="title">Local vs. Remote Templates</h1></div>
            

            <p class="para">
                Templates can be stored <em class="emphasis">locally</em>, on the client machine, or
                <em class="emphasis">remotely</em>, on the server. There are advantages and disadvantages
                to each approach.
            </p>

            <p class="para">
                In the case that a template is stored locally, it must be transfered from the client
                to the server on every request. If the content of the template rarely changes, this
                approach is inefficient. Similarly, if the template is several megabytes in size, it
                may take considerable time to transfer it to the server. Local template are useful
                in situations in which the content of the template is constantly changing.
            </p>

            <p class="para">
                The following code illustrates how to use a local template.
            </p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;setLocalTemplate(&#039;./template.docx&#039;);

// assign data and create document
</pre>


            <p class="para">
                In the case that a template is stored remotely, it is uploaded once to the server
                and then simply referenced on all subsequent requests. Obviously, this is much
                quicker than using a local template, as the template does not have to be transfered
                on every request. For speed critical applications, it is recommended to use the
                remote template method.
            </p>

            <p class="para">
                The following code illustrates how to upload a template to the server:
            </p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;uploadTemplate(&#039;template.docx&#039;);
</pre>


            <p class="para">
                The following code illustrates how to reference the remotely stored template on all
                subsequent requests:
            </p>

            <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$phpLiveDocx-&gt;setRemoteTemplate(&#039;template.docx&#039;);

// assign data and create document
</pre>

        </div>

        <div class="section" id="zend.service.livedocx.mailmerge.information"><div class="info"><h1 class="title">Getting Information</h1></div>
            

            <p class="para">
                <span class="classname">Zend_Service_LiveDocx_MailMerge</span> provides a number of methods
                to get information on field names, available fonts and supported formats.
            </p>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getfieldname"><div class="info"><p><b>Example #1 Get Array of Field Names in Template</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all field names in the
                    specified template. This functionality is useful, in the case that you create an
                    application, in which an end-user can update a template.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$templateName = &#039;template-1-text-field.docx&#039;;
$phpLiveDocx-&gt;setLocalTemplate($templateName);

$fieldNames = $phpLiveDocx-&gt;getFieldNames();
foreach ($fieldNames as $fieldName) {
    printf(&#039;- %s%s&#039;, $fieldName, PHP_EOL);
}
</pre>

            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getblockfieldname"><div class="info"><p><b>Example #2 Get Array of Block Field Names in Template</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all block field names in the
                    specified template. This functionality is useful, in the case that you create an
                    application, in which an end-user can update a template. Before such templates
                    can be populated, it is necessary to find out the names of the contained block
                    fields.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

$templateName = &#039;template-block-fields.doc&#039;;
$phpLiveDocx-&gt;setLocalTemplate($templateName);

$blockNames = $phpLiveDocx-&gt;getBlockNames();
foreach ($blockNames as $blockName) {
    $blockFieldNames = $phpLiveDocx-&gt;getBlockFieldNames($blockName);
    foreach ($blockFieldNames as $blockFieldName) {
        printf(&#039;- %s::%s%s&#039;, $blockName, $blockFieldName, PHP_EOL);
    }
}
</pre>

            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getfontnames"><div class="info"><p><b>Example #3 Get Array of Fonts Installed on Server</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all fonts installed on the
                    server. You can use this method to present a list of fonts which may be used in
                    a template. It is important to inform the end-user about the fonts installed on
                    the server, as only these fonts may be used in a template. In the case that a
                    template contains fonts, which are not available on the server,
                    font-substitution will take place. This may lead to undesirable results.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

Zend_Debug::dump($phpLiveDocx-&gt;getFontNames());
</pre>


                <div class="example-contents"><p>
                    <em class="emphasis">NOTE:</em> As the return value of this method changes very
                    infrequently, it is highly recommended to use a cache, such as
                    <span class="classname">Zend_Cache</span> - this will considerably speed up your
                    application.
                </p></div>
            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.gettemplateformats"><div class="info"><p><b>Example #4 Get Array of Supported Template File Formats</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all supported template file
                    formats. This method is particularly useful in the case that a combo list should
                    be displayed that allows the end-user to select the input format of the
                    documentation generation process.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge()

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

Zend_Debug::dump($phpLiveDocx-&gt;getTemplateFormats());
</pre>


                <div class="example-contents"><p>
                    <em class="emphasis">NOTE:</em> As the return value of this method changes very
                    infrequently, it is highly recommended to use a cache, such as
                    <span class="classname">Zend_Cache</span> - this will considerably speed up your
                    application.
                </p></div>
            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getdocumentformats"><div class="info"><p><b>Example #5 Get Array of Supported Document File Formats</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all supported document file
                    formats. This method is particularly useful in the case that a combo list should
                    be displayed that allows the end-user to select the output format of the
                    documentation generation process.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

Zend_Debug::dump($phpLiveDocx-&gt;getDocumentFormats());
</pre>

            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getimageimportformats"><div class="info"><p><b>Example #6 Get Array of Supported Image Import File Formats</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all supported imput image file
                    formats.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

Zend_Debug::dump($phpLiveDocx-&gt;getImageImportFormats());
</pre>


                <div class="example-contents"><p>
                    <em class="emphasis">NOTE:</em> As the return value of this method changes very
                    infrequently, it is highly recommended to use a cache, such as
                    <span class="classname">Zend_Cache</span> - this will considerably speed up your
                    application.
                </p></div>
            </div>

            <div class="example" id="zend.service.livedocx.mailmerge.information.getimageexportformats"><div class="info"><p><b>Example #7 Get Array of Supported Image Export File Formats</b></p></div>
                

                <div class="example-contents"><p>
                    The following code returns and displays an array of all supported export image file
                    formats. This method is particularly useful in the case that a combo list should
                    be displayed that allows the end-user to select the output format of the
                    documentation generation process.
                </p></div>

                <pre class="programlisting brush: php">
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();

$phpLiveDocx-&gt;setUsername(&#039;myUsername&#039;)
            -&gt;setPassword(&#039;myPassword&#039;);

Zend_Debug::dump($phpLiveDocx-&gt;getImageExportFormats());
</pre>


                <div class="example-contents"><p>
                    <em class="emphasis">NOTE:</em> As the return value of this method changes very
                    infrequently, it is highly recommended to use a cache, such as
                    <span class="classname">Zend_Cache</span> - this will considerably speed up your
                    application.
                </p></div>
            </div>
        </div>
    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.service.flickr.html">Zend_Service_Flickr</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.service.html">Zend_Service</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="reference.html">Zend Framework Reference</a></li>
  <li class="header up"><a href="zend.service.html">Zend_Service</a></li>
  <li><a href="zend.service.introduction.html">Introduction</a></li>
  <li><a href="zend.service.akismet.html">Zend_Service_Akismet</a></li>
  <li><a href="zend.service.amazon.html">Zend_Service_Amazon</a></li>
  <li><a href="zend.service.amazon.ec2.html">Zend_Service_Amazon_Ec2</a></li>
  <li><a href="zend.service.amazon.ec2.instance.html">Zend_Service_Amazon_Ec2: Instances</a></li>
  <li><a href="zend.service.amazon.ec2.windows.instance.html">Zend_Service_Amazon_Ec2: Windows Instances</a></li>
  <li><a href="zend.service.amazon.ec2.reserved.instance.html">Zend_Service_Amazon_Ec2: Reserved Instances</a></li>
  <li><a href="zend.service.amazon.ec2.cloudwatch.html">Zend_Service_Amazon_Ec2: CloudWatch Monitoring</a></li>
  <li><a href="zend.service.amazon.ec2.images.html">Zend_Service_Amazon_Ec2: Amazon Machine Images (AMI)</a></li>
  <li><a href="zend.service.amazon.ec2.ebs.html">Zend_Service_Amazon_Ec2: Elastic Block Storage (EBS)</a></li>
  <li><a href="zend.service.amazon.ec2.elasticip.html">Zend_Service_Amazon_Ec2: Elastic IP Addresses</a></li>
  <li><a href="zend.service.amazon.ec2.keypairs.html">Zend_Service_Amazon_Ec2: Keypairs</a></li>
  <li><a href="zend.service.amazon.ec2.zones.html">Zend_Service_Amazon_Ec2: Regions and Availability Zones</a></li>
  <li><a href="zend.service.amazon.ec2.securitygroups.html">Zend_Service_Amazon_Ec2: Security Groups</a></li>
  <li><a href="zend.service.amazon.s3.html">Zend_Service_Amazon_S3</a></li>
  <li><a href="zend.service.amazon.sqs.html">Zend_Service_Amazon_Sqs</a></li>
  <li><a href="zend.service.audioscrobbler.html">Zend_Service_Audioscrobbler</a></li>
  <li><a href="zend.service.delicious.html">Zend_Service_Delicious</a></li>
  <li><a href="zend.service.developergarden.html">Zend_Service_DeveloperGarden</a></li>
  <li><a href="zend.service.ebay.html">Zend_Service_Ebay</a></li>
  <li><a href="zend.service.ebay.finding.html">Zend_Service_Ebay_Finding</a></li>
  <li><a href="zend.service.flickr.html">Zend_Service_Flickr</a></li>
  <li class="active"><a href="zend.service.livedocx.html">Zend_Service_LiveDocx</a></li>
  <li><a href="zend.service.nirvanix.html">Zend_Service_Nirvanix</a></li>
  <li><a href="zend.service.recaptcha.html">Zend_Service_ReCaptcha</a></li>
  <li><a href="zend.service.short-url.html">Zend_Service_ShortUrl</a></li>
  <li><a href="zend.service.simpy.html">Zend_Service_Simpy</a></li>
  <li><a href="zend.service.slideshare.html">Zend_Service_SlideShare</a></li>
  <li><a href="zend.service.strikeiron.html">Zend_Service_StrikeIron</a></li>
  <li><a href="zend.service.strikeiron.bundled-services.html">Zend_Service_StrikeIron: Bundled Services</a></li>
  <li><a href="zend.service.strikeiron.advanced-uses.html">Zend_Service_StrikeIron: Advanced Uses</a></li>
  <li><a href="zend.service.technorati.html">Zend_Service_Technorati</a></li>
  <li><a href="zend.service.twitter.html">Zend_Service_Twitter</a></li>
  <li><a href="zend.service.windowsazure.html">Zend_Service_WindowsAzure</a></li>
  <li><a href="zend.service.windowsazure.storage.blob.html">Zend_Service_WindowsAzure_Storage_Blob</a></li>
  <li><a href="zend.service.windowsazure.diagnostics.manager.html">Zend_Service_WindowsAzure_Diagnostics_Manager</a></li>
  <li><a href="zend.service.windowsazure.storage.queue.html">Zend_Service_WindowsAzure_Storage_Queue</a></li>
  <li><a href="zend.service.windowsazure.storage.table.html">Zend_Service_WindowsAzure_Storage_Table</a></li>
  <li><a href="zend.service.yahoo.html">Zend_Service_Yahoo</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>